package cn.qu.netty.boot.example.controller;

import java.util.HashMap;
import java.util.Map;

import cn.qu.netty.boot.Controller;
import cn.qu.netty.boot.HttpMethod;
import cn.qu.netty.boot.RequestMapping;

@Controller
public class Controller1 {

	@RequestMapping(value = "/getStr")
	public Map<String, Object> getStr(String param) {
		Map<String, Object> result = new HashMap<>();
		result.put("param", param);
		return result;
	}
	
	@RequestMapping(value = "/getStr2/{param}")
	public Map<String, Object> getStr2(String param) {
		Map<String, Object> result = new HashMap<>();
		result.put("param", param);
		return result;
	}
	
	@RequestMapping(value = "/test/getStr3/{param1}/{param2}/{param3}")
	public Map<String, Object> getStr3(String param1, String param2, String param3) {
		Map<String, Object> result = new HashMap<>();
		result.put("param1", param1);
		result.put("param2", param2);
		result.put("param3", param3);
		return result;
	}
	
	@RequestMapping(value = "/postParam", method = HttpMethod.POST)
	public Map<String, Object> postParam(Map<String, Object> param) {
		return param;
	}
	
	@RequestMapping(value = "/postParam2", method = HttpMethod.POST)
	public Map<String, Object> postParam2(String name, String phone, Map<String, Object> param) {
		param.put("name", name);
		param.put("phone", phone);
		return param;
	}
	
	@RequestMapping(value = "/postParam3", method = HttpMethod.POST)
	public Map<String, Object> postParam3(String name, Map<String, Object> param, String phone) {
		param.put("name", name);
		param.put("phone", phone);
		return param;
	}
	
	@RequestMapping(value = "/postParam4/{name}", method = HttpMethod.POST)
	public Map<String, Object> postParam4(String name, Map<String, Object> param) {
		param.put("name", name);
		return param;
	}
	
	@RequestMapping(value = "/postParam5/{name}/{phone}", method = HttpMethod.POST)
	public Map<String, Object> postParam5(String name, String phone, Map<String, Object> param) {
		param.put("name", name);
		param.put("phone", phone);
		return param;
	}
	
	@RequestMapping(value = "/postParam6/{name}/{phone}", method = HttpMethod.POST)
	public Map<String, Object> postParam6(String name, Map<String, Object> param, String phone) {
		param.put("name", name);
		param.put("phone", phone);
		return param;
	}
	
	@RequestMapping(value = "/postParam7/{name}", method = HttpMethod.POST)
	public Map<String, Object> postParam7(String name) {
		Map<String, Object> result = new HashMap<>();
		result.put("name", name);
		return result;
	}
	
	@RequestMapping(value = "/postParam8", method = HttpMethod.POST)
	public Map<String, Object> postParam8(String name) {
		Map<String, Object> result = new HashMap<>();
		result.put("name", name);
		return result;
	}

}
